Some integrated circuits enable the rapid execution of software applications. During software development, it is sometimes necessary to analyze how well various parts of the software are functioning. This analysis may lead on to ‘de-bugging’ of the software as well as software testing. De-bugging involves improving software reliability and software performance. Software testing serves to exercise parts of the software.
Software is usually built up from blocks of linear code. Each block of code consists of a sequence of instructions that can be entered only at the beginning of the code sequence, and exited only at the end of the code sequence. So, once the program code of a block has commenced running, that code will be executed until the end of the block is reached. The program control flow may then select another block for execution.
FIG. 1 shows a control flow graph 100, which is a directed graph that provides a diagrammatic representation of the ‘program control flow’ of computer program code that makes up the piece of software. A control flow graph comprises an ‘ENTRY’ point and an ‘EXIT’ point, and various vertices, each of which represents a block of code within the computer program code. In this description, the terms ‘block of code’ and ‘vertex’ may be assumed in various instances to mean the same. The vertices in FIG. 1 are labelled A to F. The control flow graph also shows ‘edges’, which are the directed arrows connecting the vertices and which represent the control flow between the blocks of code. The software execution flows along the edges, between blocks.
When a piece of software runs, it is important to gather information about those blocks that are executed. This information may be gathered by ‘instrumenting’ the source code. The source code of a block may be instrumented by placing a ‘probe’ into it. A probe is typically a set of instructions whose task is to detect and signal when a particular block runs.
When a probe is encountered, during execution of a block, the probe performs an action or set of actions. These actions may include, for example: incrementing a counter to show how many times the block has been executed; marking a flag; or writing a token to a file. Probes may also, or alternatively, be associated with the edges of the control flow graph.
It is known that the simplest method of finding out when each of the program blocks executes is to place a probe in every software block. The probe detects each time that the respective block is executed, and signals this to a monitoring system. In effect, the program is instrumented with probes that record passes through each part/section of the executed program. However, each time a probe detects and reports that its software block is being executed, a delay is introduced. Furthermore, the more times that probes report their software blocks being executed, the more data is produced, which may be required to be stored, for example within an on-die buffer. Thus, it is desirable to minimize the number of probes invoked during the program execution.